package com.lysj.admin.master.common.spring.mpbase;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * @author Created by zk on 2019-12-24 15:17
 * @description 实体类请慎重提供默认值，修改的默认方法会初始化实体类，导致修改紊乱
 */
@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper = true)
public class MyEntity extends IdEntity{
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")//Date转换成String  一般后台传值给前台时用
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")//Date转换成String  一般后台传值给前台时用
    private Date updateTime;
}
